<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>clean</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : April 1993</div>
    <p>
      <b>clean</b> -  cleans matrices (round to zero small entries)    </p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>[B]=clean(A [,epsa [,epsr]])  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>A</b>
        </tt>: a numerical matrix (scalar, polynomial, sparse...)</li>
      <li>
        <tt>
          <b>epsa,epsr</b>
        </tt>: real numbers (default values resp. 1.d-10 and 1.d-10)</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
    This function eliminates (i.e. set to zero) all the coefficients 
    with absolute value &lt; <tt>
        <b>epsa</b>
      </tt> and relative value &lt; <tt>
        <b>epsr</b>
      </tt> 
    (relative means relative w.r.t. 1-norm of coefficients)
    in a polynomial (possibly matrix polynomial or rational
    matrix).</p>
    <p>
    Default  values are <tt>
        <b>epsa=1.d-10</b>
      </tt> and <tt>
        <b>epsr=1.d-10;</b>
      </tt>
    </p>
    <p>
    For a constant (non polynomial) matrix <tt>
        <b>clean(A,epsa)</b>
      </tt> sets to zero all
    entries of <tt>
        <b>A</b>
      </tt> smaller than <tt>
        <b>epsa</b>
      </tt>.</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

x=poly(0,'x');
w=[x,1,2+x;3+x,2-x,x^2;1,2,3+x]/3;
w*inv(w)
clean(w*inv(w))
 
  </pre>
  </body>
</html>
